home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / AdobeExamples / NX_CtlPoints / ControlView.h < prev    next >
Text File  |  1995-06-12  |  4KB  |  126 lines

  1.  
  2. /*
  3.  * (a)  (C) 1990 by Adobe Systems Incorporated. All rights reserved.
  4.  *
  5.  * (b)  If this Sample Code is distributed as part of the Display PostScript
  6.  *    System Software Development Kit from Adobe Systems Incorporated,
  7.  *    then this copy is designated as Development Software and its use is
  8.  *    subject to the terms of the License Agreement attached to such Kit.
  9.  *
  10.  * (c)  If this Sample Code is distributed independently, then the following
  11.  *    terms apply:
  12.  *
  13.  * (d)  This file may be freely copied and redistributed as long as:
  14.  *    1) Parts (a), (d), (e) and (f) continue to be included in the file,
  15.  *    2) If the file has been modified in any way, a notice of such
  16.  *      modification is conspicuously indicated.
  17.  *
  18.  * (e)  PostScript, Display PostScript, and Adobe are registered trademarks of
  19.  *    Adobe Systems Incorporated.
  20.  * 
  21.  * (f) THE INFORMATION BELOW IS FURNISHED AS IS, IS SUBJECT TO
  22.  *    CHANGE WITHOUT NOTICE, AND SHOULD NOT BE CONSTRUED
  23.  *    AS A COMMITMENT BY ADOBE SYSTEMS INCORPORATED.
  24.  *    ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY
  25.  *    OR LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO
  26.  *    WARRANTY OF ANY KIND (EXPRESS, IMPLIED OR STATUTORY)
  27.  *    WITH RESPECT TO THIS INFORMATION, AND EXPRESSLY
  28.  *    DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY, 
  29.  *    FITNESS FOR PARTICULAR PURPOSES AND NONINFRINGEMENT
  30.  *    OF THIRD PARTY RIGHTS.
  31.  */
  32.  
  33. /*
  34.  *    ControlView.h
  35.  *
  36.  *    Version:    2.0
  37.  *    Author:    Ken Fromm
  38.  *    History:
  39.  *            03-07-91        Added this comment.
  40.  */
  41.  
  42. #import "ControlPoint.h"        
  43. #import <appkit/appkit.h>
  44. #import <appkit/View.h>
  45.  
  46. #define MAX_POINTS       1000            /* Maximum number of points */
  47. #define MAX_ARRAY       (2*MAX_POINTS)    /* Maximum size of pt arrays */
  48. #define MAX_UPATHOPS    MAX_ARRAY    /* Maximum points for a user path */
  49.  
  50.  
  51. /***********************************************************************************************/
  52. /* Note: The two limits below are necessary because ufill and rectstroke will produce     */
  53. /* limitchecks for numbers exceeding these values.                                                                  */
  54. /***********************************************************************************************/
  55. #define MAX_UPATHPTS    2800            /* Maximum points for a user path */
  56. #define MAX_RECTPTS    525                /* Maximum rects for a rect stroke */
  57.  
  58.  
  59. #define BGCOLOR               NX_WHITE        /* Background color */
  60. #define BGCOLORSTR        0.0                /* Background stroke color */
  61. #define BGWIDTHSTR        2.0                /* Background stroke width */
  62.  
  63. #define DRAWALL            0xfe                /* Draw with all methods */ 
  64.  
  65. @interface ControlView : View
  66. {    
  67.     BOOL    PSTrace;
  68.     
  69.     char        *OpsBuffer;
  70.     
  71.     int        numberOfPoints, indexOfPoints;
  72.  
  73.     float        *XYPoints, *XYBuffer;
  74.     
  75.     id        drawMethodsMatrix, displayTimesMatrix, numberPointsMatrix,
  76.             imageId, controlPoint;
  77.  
  78.     union {
  79.         struct {
  80.             unsigned char basic:1;
  81.             unsigned char usercache:1;
  82.             unsigned char userpath:1;
  83.             unsigned char rectop:1;
  84.             unsigned char composite:1;
  85.             unsigned char show:1;
  86.             unsigned char xyshow:1;
  87.             unsigned char PADDING:1;
  88.         }     flags;
  89.         unsigned char        field;
  90.     } drawFlags;
  91. }
  92.  
  93. - initFrame:(const NXRect *) frameRect;
  94.  
  95. -free;
  96.  
  97. -setDrawMethodsMatrix:anObject;
  98. -setDisplayTimesMatrix:anObject;
  99. -setNumberPointsMatrix:anObject;
  100. -setControlPoint:anObject;
  101.  
  102. -setButtonTitle:(OP) title;
  103. -setButtonEnable:(BOOL) enable;
  104.  
  105. -psTrace:sender;
  106. -configureDependence:sender;
  107. -configurePoints:sender;
  108. -makePoints:sender;
  109. -eraseTimes:sender;
  110.  
  111. -drawViewOne:sender;
  112. -drawViewAll:sender;
  113.  
  114. -drawBasic:(int) cell;
  115. -drawUserCache:(int) cell;
  116. -drawUserPath:(int) cell;
  117. -drawRectOp:(int) cell;
  118. -drawComposite:(int) cell;
  119. -drawShow:(int) cell;
  120. -drawXYShow:(int) cell;
  121.  
  122. -drawSelf:(NXRect *)r :(int) count;
  123.  
  124. @end
  125.  
  126.